<div class="frame_addProductDiv">

	<form id="statistics_countryForm" method="post" action="administrator-statistics-member">

	  <table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#c8d9e9">

		<tr>

		  <td colspan="2" class="se" style="text-align:left">

		  	<strong>按条件筛选</strong>

		  </td>

		</tr>

		<!-- 
		<tr>

		  <td valign="middle" class="ri-bbgg"><span class="red"></span> 分组： </td>

		  <td class="le">

		  	<div>
				<select name="groupby">
					<option value="1">按用户分组</option>
				</select>
			</div>


		  </td>

		</tr>
		 -->

		<tr>

		  <td valign="middle" class="ri-bbgg"><span class="red"></span> 输入用户email： </td>

		  <td class="le">

		  	<div>
				<input type="text" name="email" value="<?php echo $this->params['email']?>" />
			</div>


		  </td>

		</tr>

		<tr>

		  <td valign="middle" class="ri-bbgg"><span class="red"></span> 指定时间： </td>

		  <td class="le">

		  	<div>
		  		
		  		<input class="form-control" type="text" name="timestart" onclick="new Calendar().show(this);" readonly="readonly" value="<?php if($this->params['timestart']) { echo $this->params['timestart']; } else { echo date('Y-m-d'); } ?>" />
	               至<input class="form-control" type="text" name="timeend" onclick="new Calendar().show(this);" readonly="readonly" value="<?php if($this->params['timeend']) { echo $this->params['timeend']; } else { echo date('Y-m-d'); } ?>" />
			</div>


		  </td>

		</tr>

		<?php if($this->total): ?>
		<tr>

		  <td valign="middle" class="ri-bbgg"><span class="red"></span> 综合统计： </td>

		  <td class="le">

		  	<div>
				总订单数：<?php echo intval($this->total['t']) ?><br /><br />
				订单总金额：<?php echo ($this->total['m'] == null) ? 0 : $this->total['m'] ?>
			</div>


		  </td>

		</tr>
		<?endif; ?>

		<tr>

		  <td valign="top" class="ri-bbgg"><span class="red"></span></td>

		  <td class="le">

		  	<div>
				<input type="submit" value="提交搜索" />
			</div>


		  </td>

		</tr>
	  </table>
	</form>
	<?php if(!empty($this->list)): ?>
	<table width="100%" border="1" cellpadding="0" cellspacing="0" bordercolor="#c8d9e9" style="margin-top: 10px;">
		<tr>
			<td valign="middle" height="20" align="center">订单号</td>
			<td valign="middle" height="20" align="center">下订时间</td>
			<td valign="middle" height="20" align="center">买家</td>
			<td valign="middle" height="20" align="center">订单金额</td>
			<td valign="middle" height="20" align="center">状态</td>
		</tr>
		<?php foreach ($this->list as $value): ?>
		<tr>
			<td valign="middle" height="20" align="center">G<?=$value['orderid']?></td>
			<td valign="middle" height="20" align="center"><?=date('Y-m-d H:i:s',$value['add_time'])?></td>
			<td valign="middle" height="20" align="center">
				<?php if (!empty($value['username'])):?>
								<?php echo $value['username'];?>
							<?php else:?>
								<?php echo '从' . $value['reg_from'] . '注册';?>
							<?php endif;?>
			</td>
			<td valign="middle" height="20" align="center">$<?=round($value['money']*$value['discount'],2)?></td>
			<td valign="middle" height="20" align="center">
				<?php 
								$score = new CScore();								
								if ($value['flid'] >= 2 && $value['flid'] != 6 && $value['flid'] != 7 && $value['flid'] != 8) {
									if ($value['order_score_statu'] == 0 && $value['order_score_statu'] == 0) {
										echo '未派送 ,应送' . $score->dollar2score(round($value['money']*$value['discount'],2)/ORDER_DOLLAR);
									} elseif ($value['order_score_statu'] == 1 && $value['order_score_statu'] == 1) {
										echo '已派送';
									}
								} else {
									echo '未付款或取消';
								}
							?>
			</td>
		</tr>
		<?php endforeach; ?>
		<tr><td colspan="5" height="24" align="center"><?php echo $this->page ?></td></tr>
	</table>
	<?php endif; ?>

</div>